<template>
  <div class="campus-binhai">
    <h1>你好,这里是温州理工滨海校区</h1>
    <div>
      <input v-model="studentId" placeholder="请输入学号" />
      <button @click="searchStudent">查找学生</button>
    </div>
    <div v-if="studentInfo">
      <h2>学生信息</h2>
      <p>姓名: {{ studentInfo.name }}</p>
      <p>学号: {{ studentInfo.id }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'CampusBinhai',
  data() {
    return {
      studentId: '',
      studentInfo: null
    };
  },
  methods: {
    searchStudent() {
      // 模拟查找学生信息
      if (this.studentId === '12345') {
        this.studentInfo = { name: '张三', id: '12345' };
      } else {
        this.studentInfo = null;
        alert('未找到该学生信息');
      }
    }
  }
}
</script>

<style scoped>
.home {
  text-align: center;
  padding: 20px;
}
input {
  margin-right: 10px;
  padding: 5px;
}
button {
  padding: 5px 10px;
}
</style>